// Copyright (c) 2014 Morten Bakkedal
// This code is published under the MIT License.

using System;
using System.Collections.Generic;

using FuncLib.DualFunctions.Collections.Generic;
using FuncLib.Functions;

namespace FuncLib.DualFunctions.Collections
{
	[Serializable]
	public class Gradient : ReadOnlyDictionary<Variable, double>
	{
		public Gradient()
			: this(new Dictionary<Variable, double>())
		{
		}

		public Gradient(IDictionary<Variable, double> gradient)
			: base(new Dictionary<Variable, double>(gradient))
		{
		}

		public bool Contains(Variable variable)
		{
			return ContainsKey(variable);
		}
	}
}
